package day07;

import java.util.Scanner;

public class Test8_Season {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.print("请输入月份（1-12）：");
        int month = scanner.nextInt();

        if (month < 1 || month > 12) {
            System.out.println("输入月份有误");
            return; // 提前结束程序
        }

        // 根据月份判断季节
        String season = getSeason(month);
        System.out.println("月份 " + month + " 属于 " + season);
    }

    // 方法：根据月份判断季节
    public static String getSeason(int month) {
        if (month >= 12 || month <= 2) {
            return "冬";
        } else if (month >= 3 && month <= 5) {
            return "春";
        } else if (month >= 6 && month <= 8) {
            return "夏";
        } else { // 9-11
            return "秋";
        }
    }
}
